<template>
  <div class="table-page-search-wrapper">
    <el-form :model="form" ref="form" :inline="true" @submit.native.prevent>
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item class="mb0" label="考评等级名称" prop="moralityLevelName">
            <el-input
              clearable
              @keyup.native.enter="handleSearch"
              v-model="form.moralityLevelName"
              placeholder="请输入考评等级名称"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item class="mb0">
            <el-tooltip class="item" content="查询" effect="dark" placement="top">
              <el-button type="primary" @click="handleSearch" icon="el-icon-search" />
            </el-tooltip>
            <el-tooltip class="item" content="重置" effect="dark" placement="top">
              <el-button @click="handleReset" icon="el-icon-refresh-right" />
            </el-tooltip>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        moralityLevelName: null,
        pageNo: 1
      }
    }
  },
  methods: {
    handleSearch() {
      this.$emit('search', this.form)
    },
    handleReset() {
      this.$refs.form.resetFields()
      this.$emit('search', this.form)
    }
  }
}
</script>
